<?php
// 修改
include "../config.php";
$id=$_POST['id'];
$name=$_POST['name'];
$addr=$_POST['addr'];
$tel=$_POST['tel'];
$email=$_POST['email'];

$sql="update relation set name='{$name}',addr='{$addr}',tel='{$tel}',email='{$email}' where id='{$id}'";
if($mysqli->query($sql)){
	// 修改成功
	echo "<script>location='../index.php?action=infoIndex'</script>";

}else{
// 修改失败
echo "<script>location='../index.php?action=infoEdit&id={$id}'</script>";
}

?>